<template>
    <div>
        <ExtForm ref="ExtForm" :formfields="formfields" @changeEventHandler="changeEventHandler"></ExtForm>
    </div>
</template>
<script>
import ExtForm from '@/components/lt/codeGenerator/components/ExtForm'
import pageSetting from '@/components/lt/codeGenerator/pageSetting'
import Vue from 'vue'
import draggable from 'vuedraggable'
import {SysMixin} from '@/mixins/SysMixin'


export default {
    name:'GridFormAttribute',
    components:{draggable,ExtForm
    },
    mixins:[SysMixin],
    props:{
        component:{
           type:Object,
           default:()=>{}
        },
    },
    watch:{
        
    },
    data(){
        return{
            componentTypeMap:new Map(),
            pageSetting,
            formfields:[
                {field:'label',label:'标题',component:pageSetting.常量.表单组件类型.单行文本,initialValue:this.component.label,rules: [{ required: true, message: '不能为空!' }]},
                {field:'ref',label:'ref',component:pageSetting.常量.表单组件类型.单行文本,initialValue:this.component.ref,disabled:true},
            ],
         
      
        }
    },
   
    created(){
      
    },
    mounted () {
        this.$nextTick(() => {
           
        })
    },
    methods:{
       
        changeEventHandler(item){
            if(item["label"]){
                this.component.label=item.label
                for(let i=0;i<this.component.components.length;i++){
                    if(this.component.components[i].type==pageSetting.常量.组件.标题){
                        this.component.components[i].label=item.label
                    }
                }
            }else{
                for (const key in item) {
                    Vue.set(this.component.props,key,item[key])
                }
            }

        },
        
    }
}
</script>

<style scoped>
/* ::v-deep .ant-select-selection{
    border: none !important;
    box-shadow: none !important;
    background-color: #ffffff !important;
    color:rgba(0, 0, 0, 0.45) !important;
}
::v-deep .ant-select-arrow{
    display: none !important;
} */
</style>

